"use strict"
const fs = require('fs');
const path = require('path');
const watchPath = path.join(__dirname,'watch.txt');
//webstorm 中，要想看到效果，要及时按ctrl+s 给watch 发送一个信号
fs.watchFile(watchPath,{
    persistent: true,
    interval: 500
},(curr, prev) => {
    // console.log(curr);
    // console.log(prev);
    console.log(`文件文件改变时间 is: ${curr.mtime}`);
    console.log(`上次文件改变时间 is: ${prev.mtime}`);
});